﻿using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Spriter.Annotations;

namespace Spriter
{
    public class ViewModel : INotifyPropertyChanged
    {
        private string _filename;
        private string _folderLocation;
        private IList<string> _files;

        public ViewModel()
        {
            Files = new List<string>();
        }

        public string FolderLocation
        {
            get { return _folderLocation; }
            set
            {
                _folderLocation = value;
                OnPropertyChanged("FolderLocation");
            }
        }

        public string Filename
        {
            get { return _filename; }
            set
            {
                _filename = value;
                OnPropertyChanged("Filename");
            }
        }

        public IList<string> Files
        {
            get { return _files; }
            set { _files = value; OnPropertyChanged("Files");}
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}